﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClassLibrary;

namespace CS
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public StringBuilder sbStr = new StringBuilder();
        private void button1_Click(object sender, EventArgs e)
        {
            Collection names = new Collection();

            names.Add("David");

            names.Add("Bernica");

            names.Add("Raymond");

            names.Add("Clayton");

            foreach (Object name in names)
            {
                sbStr.AppendLine(name.ToString());// + System.Environment.NewLine);
            }

            sbStr.AppendLine("Number of names: " + names.Count());

            names.Remove("Raymond");

            sbStr.AppendLine("Number of names: " + names.Count());

            names.Clear();

            sbStr.AppendLine("Number of names: " + names.Count());
            txtOutput.Text = sbStr.ToString();
        }

    }
}
